Skip to contentSkip to conversation

Disable specific URLs in bmcweb

DISCUSSION Alan Kuo (郭振維) 4 participants 5 messages Sep 2, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

Are there some configuration files in bmcweb that can be used to disable specific URLs and HTTP methods ?

Thanks,
Alan

#1 lore raw
Quoted 3 lines · Alan Kuo (郭振維)

Are there some configuration files in bmcweb that can be used to disable specific URLs and HTTP methods ?

There are compile time options that can disable features (and therefore URLs associated). They're listed in the CMakeLists.txt file.

As far as disabling particular methods, why are you wanting to disable them? It seems odd to want to disable a few particular HTTP verbs.

#2 lore raw

Hi Ed,

In this particular case, I think Alan is talking about disabling the POST for certain resources, effectively making them readonly. One example I remember talking to him about was disabling the addition of new users via bmcweb.

- Richard

Quoted 13 lines · Ed Tanous
Quoted 2 lines · Alan Kuo (郭振維)

Are there some configuration files in bmcweb that can be used to disable

specific URLs and HTTP methods ?

Quoted 1 line

There are compile time options that can disable features (and therefore URLs associated). They're listed in the CMakeLists.txt file.

As far as disabling particular methods, why are you wanting to disable them? It seems odd to want to disable a few particular HTTP verbs.

#3 lore raw
Quoted 5 lines · Richard Hanley

Hi Ed,

In this particular case, I think Alan is talking about disabling the POST for certain resources, effectively making them readonly. One example I remember talking to him about was disabling the addition of new users via bmcweb.

Gotcha.

In that particular case, Redfish PrivilegeRegistry schema is probably what you're looking for. To handle that specific case, you would add a mapping that looks like:

        {
            "Entity": "ManagerAccount",
            "OperationMap": {
                "GET": [
                    {
                        "Privilege": [
                            "Login"
                        ]
                    }
                ],
                "HEAD": [
                    {
                        "Privilege": [
                            "Login"
                        ]
                    }
                ],
                "PATCH": [
                    {
                        "Privilege": []
                    }
                ],
                "POST": [
                    {
                        "Privilege": [,
                "PUT": [
                    {
                        "Privilege": []
                    }
                ],
                "DELETE": [
                    {
                        "Privilege": []
                    }
                ]
            }
        },

I don't believe there's an implementation of PrivilegeRegistry for bmcweb today, although we kept it in mind (ish) when we built the privileges system. If you want to chat more about how you could add it, I'm happy to talk more specifics with you.

-Ed

Quoted 14 lines

- Richard

Quoted 11 lines · Ed Tanous
Quoted 3 lines · Alan Kuo (郭振維)

Are there some configuration files in bmcweb that can be used to disable specific URLs and HTTP methods ?

There are compile time options that can disable features (and therefore URLs associated). They're listed in the CMakeLists.txt file.

As far as disabling particular methods, why are you wanting to disable them? It seems odd to want to disable a few particular HTTP verbs.

#4 lore raw
Quoted 9 lines · Ed Tanous
Quoted 4 lines · Richard Hanley

Hi Ed,

In this particular case, I think Alan is talking about disabling the POST for certain resources, effectively making them readonly. One example I remember talking to him about was disabling the addition of new users via bmcweb.

Gotcha.

In that particular case, Redfish PrivilegeRegistry schema is probably what you're looking for. To handle that specific case, you would add

Here is an alternate solution: use the administrator account (currently "root") to create a new user with the Operator role, then use that new account and discontinue using the Administrator account.  For example (change the password):

|curl -x POST https://${bmc}/redfish/v1/AccountService/Accounts/ -d '{"UserName": "joeoperator", "Password": "0penBmc1", "RoleId": "Operator"}'|

- Joseph

Quoted 58 lines

a mapping that looks like:

         {
             "Entity": "ManagerAccount",
             "OperationMap": {
                 "GET": [
                     {
                         "Privilege": [
                             "Login"
                         ]
                     }
                 ],
                 "HEAD": [
                     {
                         "Privilege": [
                             "Login"
                         ]
                     }
                 ],
                 "PATCH": [
                     {
                         "Privilege": []
                     }
                 ],
                 "POST": [
                     {
                         "Privilege": [,
                 "PUT": [
                     {
                         "Privilege": []
                     }
                 ],
                 "DELETE": [
                     {
                         "Privilege": []
                     }
                 ]
             }
         },

I don't believe there's an implementation of PrivilegeRegistry for bmcweb today, although we kept it in mind (ish) when we built the privileges system. If you want to chat more about how you could add it, I'm happy to talk more specifics with you.

-Ed

Quoted 12 lines

- Richard

Quoted 9 lines · Ed Tanous
Quoted 2 lines · Alan Kuo (郭振維)

Are there some configuration files in bmcweb that can be used to disable specific URLs and HTTP methods ?

There are compile time options that can disable features (and therefore URLs associated). They're listed in the CMakeLists.txt file.

As far as disabling particular methods, why are you wanting to disable them? It seems odd to want to disable a few particular HTTP verbs.