-
Notifications
You must be signed in to change notification settings - Fork 0
Initial Push #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Initial Push #1
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0566515
Initial Release, added first batch of functions and pester template f…
rdonovan92 dcb0115
Fixed scriptanalyzer changes
rdonovan92 e72b32e
script tweaks
rdonovan92 2f32498
added blank space after each function
rdonovan92 98639ca
Comment changes
rdonovan92 9948382
fixed wildcard usage in psd1
rdonovan92 78e2ca0
updated example in New-BoxFolderCollaboration
rdonovan92 8f496c9
one more parameter change example for New-BoxFolderCollaboration func…
rdonovan92 c91450c
Removed New-Boxfoldercollaboration and split into two functions
rdonovan92 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Pester Tests | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [macos-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Install dependencies | ||
| run: Install-Module -Name 'Pester' -Force -SkipPublisherCheck | ||
| shell: pwsh | ||
| - name: Run tests | ||
| run: Invoke-Pester -Path './test/' -CI | ||
| shell: pwsh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: ScriptAnalyzer | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [windows-latest] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Install dependencies | ||
| run: Install-Module -Name 'PSScriptAnalyzer' -Force -SkipPublisherCheck | ||
| shell: pwsh | ||
| - name: ScriptAnalyzer | ||
| run: Invoke-ScriptAnalyzer -Path '.\src\' -Recurse -EnableExit | ||
| shell: pwsh | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,29 @@ | ||
| University of Illinois/NCSA Open Source License | ||
| Copyright (c) 2026 University of Illinois. All rights reserved. | ||
|
|
||
| Copyright (c) 2023 by the Board of Trustees of the University of | ||
| Illinois. All rights reserved. | ||
|
|
||
| Developed by Cybersecurity and Technology Services | ||
| University of Illinois | ||
| https://techservices.illinois.edu | ||
| Developed by: Cybersecurity Engineering | ||
| University of Illinois | ||
| https://github.com/techservicesillinois/Secops-Powershell-Box | ||
|
|
||
| Permission is hereby granted, free of charge, to any person | ||
| obtaining a copy of this software and associated documentation files | ||
| (the "Software"), to deal with the Software without restriction, | ||
| including without limitation the rights to use, copy, modify, merge, | ||
| publish, distribute, sublicense, and/or sell copies of the Software, | ||
| and to permit persons to whom the Software is furnished to do so, | ||
| subject to the following conditions: | ||
|
|
||
| - Redistributions of source code must retain the above copyright notice, | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| this software and associated documentation files (the "Software"), to deal with | ||
| the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
| of the Software, and to permit persons to whom the Software is furnished to | ||
| do so, subject to the following conditions: | ||
| * Redistributions of source code must retain the above copyright notice, | ||
| this list of conditions and the following disclaimers. | ||
| * Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimers in the documentation | ||
| and/or other materials provided with the distribution. | ||
| * Neither the names of Cybersecurity Engineering, University of Illinois, | ||
| nor the names of its contributors may be used to endorse or promote products | ||
| derived from this Software without specific prior written permission. | ||
|
|
||
| - Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimers in the | ||
| documentation and/or other materials provided with the distribution. | ||
|
|
||
| - Neither the names of University of Illinois nor the names of its | ||
| contributors may be used to endorse or promote products derived from | ||
| this Software without specific prior written permission. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH | ||
| THE SOFTWARE. | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,112 @@ | ||
| ## About | ||
|  | ||
|  | ||
|
|
||
| This repository is used by Cybersecurity operations teams at the | ||
| University of Illinois as a GitHub template. | ||
| # What is This? | ||
|
|
||
| This resource helps comply with University of Illinois | ||
| Cybersecurity standards - including [IT-07][it07], [IT08][it08], | ||
| and [IT13][it13]. | ||
| This is a PowerShell module for automating interactions with the Box API. It provides a clean, reusable set of functions for managing folders, files, and user access within Box. | ||
|
|
||
| [it07]: https://go.illinois.edu/secstd-IT07 | ||
| [it08]: https://go.illinois.edu/secstd-IT08 | ||
| [it13]: https://go.illinois.edu/secstd-IT13 | ||
| The module is designed for automation scenarios such as: | ||
|
|
||
| See [Cybersecurity Development on the Illinois Knowledge Base][kbsearch] | ||
| for information about our development standards. | ||
| Ticket-driven provisioning | ||
|
|
||
| [kbsearch]: https://answers.uillinois.edu/illinois/search.php?q=cybersecurity+developer&cat=0 | ||
| Scheduled jobs | ||
|
|
||
| The remainder of this `README.md` contains example text. | ||
| Azure Automation runbooks | ||
|
|
||
| ## Data Sources | ||
| Security and compliance workflows | ||
|
|
||
| |Data Store|Data Type|Sensitivity|Notes| | ||
| |----------|---------|-----------|-----| | ||
| It simplifies Box API usage by handling authentication, REST calls, and common operations behind easy-to-use PowerShell functions. | ||
|
|
||
| ## Endpoint Connections | ||
| # How do I install it? | ||
|
|
||
| |Endpoint|Purpose|Stage|Access| | ||
| |--------|-------|-----|------| | ||
| The latest stable release is always available via the PSGallery. | ||
|
|
||
| ## Product Support | ||
| This will install on the local machine: | ||
|
|
||
| This product is supported by Cybersecurity teams at the | ||
| University of Illinois Urbana-Champaign on a best-effort basis. | ||
| Install-Module -Name 'UofIBox' | ||
|
|
||
| As of the last update to this README, the expected End-of-Life and | ||
| End-of-Support dates of this product are <YEAR MONTH>. | ||
| ### Prerequisites | ||
|
|
||
| End-of-Life was decided upon based on these dependencies: | ||
| PowerShell 7+ | ||
|
|
||
| - <dependency (YEAR MONTH) > | ||
| - <dependency (YEAR MONTH) > | ||
| A Box application configured for Client Credentials Grant | ||
|
|
||
| Box Client ID, Client Secret, and Enterprise ID | ||
|
|
||
| # How does it work? | ||
|
|
||
| The module is built around two core components: | ||
|
|
||
| Authentication | ||
|
|
||
| New-BoxSession authenticates to Box using OAuth Client Credentials and stores the access token for reuse. | ||
|
|
||
| $Credential = Get-Credential | ||
| New-BoxSession -Credential $Credential | ||
| REST Wrapper | ||
|
|
||
| Invoke-BoxRestCall is a centralized wrapper for all API calls. It handles: | ||
|
|
||
| Authentication headers | ||
|
|
||
| Base URI construction | ||
|
|
||
| JSON conversion | ||
|
|
||
| Error handling | ||
|
|
||
| File downloads | ||
|
|
||
| Key Functions | ||
| Folder Management | ||
|
|
||
| New-BoxFolderWithCollaboration – Create folders and assign users/roles | ||
|
|
||
| Get-BoxFolder – Retrieve folder metadata | ||
|
|
||
| Remove-BoxFolder – Delete folders | ||
|
|
||
| File Management | ||
|
|
||
| Upload-BoxFile – Upload files | ||
|
|
||
| Get-BoxFile – Retrieve file metadata | ||
|
|
||
| Remove-BoxFile – Delete files | ||
|
|
||
| Receive-BoxFile – Download files | ||
|
|
||
| Folder Download | ||
|
|
||
| Receive-BoxFolder – Recursively downloads a folder and recreates the structure locally | ||
|
|
||
| Example Workflow | ||
| $Credential = Get-Credential | ||
| New-BoxSession -Credential $Credential | ||
|
|
||
| New-BoxFolderWithCollaboration ` | ||
| -FolderName "SecurityProject" ` | ||
| -Login user@company.com ` | ||
| -Role editor | ||
|
|
||
| # How do I help? | ||
|
|
||
| Contributions are welcome. You can help by: | ||
|
|
||
| Reporting bugs or issues | ||
|
|
||
| Suggesting new features | ||
|
|
||
| Improving documentation | ||
|
|
||
| Refactoring functions for performance or readability | ||
|
|
||
| If contributing: | ||
|
|
||
| Follow existing function structure and naming conventions | ||
|
|
||
| Ensure all functions use Invoke-BoxRestCall | ||
|
|
||
| Include comment-based help for all functions | ||
|
|
||
| # To Do | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.